package com.elong.android.specialhouse;

import com.elong.framework.net.request.BaseRequestOption;
import com.elong.framework.netmid.api.IHusky;
import com.elong.framework.netmid.api.ReqType;

/**
 * @ClassName: ApartmentAPI
 * @Description: apartment 接口清单
 * @author: kaiqi.li
 * @date:2015-8-5 下午3:29:42
 */
public enum ApartmentAPI implements IHusky {

    getCityList("house/getCityList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    destinationSuggest("suggest/destinationSuggest", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    createOrder("order/create", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    login("account/login", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    pluginLogin("account/elongPluginLogin", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getUserId("account/verifyAccessToken", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getCommentList("comment/commentList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getHouseTypeList("publishHouse/getHouseTypeList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    publishHouseNew("publishHouse/publishHouseNew", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getVerifyCode("account/sendCode", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getDynamicVerifyCode("account/sendDynamicCode", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    register("account/register", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getSuggestHouseList("house/suggestHouseList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getTenantCalendar("calendar/getTenantCalendar", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getLandlordCalendar("calendar/getLandlordCalendar", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    saveCalendarSet("calendar/saveCalendarSet", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getCalendarSet("calendar/getCalendarSet", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    searchList("house/searchList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getApartmentDetails("house/searchDetail", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getADInfoList("ad/getADInfoList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getLocationList("house/getLocationList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    houseSuggest("suggest/houseSuggest", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getSpecialFacilitiesList("publishHouse/getSpecialFacilitiesList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getCommunalFacilitiesList("publishHouse/getCommunalFacilitiesList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getRoomFacilitiesList("publishHouse/getRoomFacilitiesList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    publishHouseFinish("publishHouse/publishHouseFinished", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    publishHouseDetail("publishHouse/publishHouseDetail", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    updateHouse("houseAdmin/updateHouse", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getHouseAdminList("houseAdmin/getHouseAdminList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getHouseAdminDetail("houseAdmin/getHouseAdminDetail", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    editImageInfo("image/editImageInfo", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    deleteImage("image/deleteImage", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getAuthState("account/getAuthState", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    publishInsertPrice("price/publishInsertPrice", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    updatePrice("price/updatePrice", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    updateInventoryState("inventory/updateInventoryState", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getOrderList("order/orderList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    publishUpdatePrice("price/publishUpdatePrice", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    publishGetPrice("price/publishGetPrice", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    orderDetail("order/orderDetail", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    addCollectionInfo("collection/addCollectionInfo", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getCollectionInfo("collection/getCollectionInfo", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    deleteCollectionInfo("collection/deleteCollectionInfo", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    publishEvaluation("comment/addComment", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getBillsByType("order/orderBillList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getOrderLog("order/orderLog", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    orderCancel("order/orderCancel", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    confirmCheckIn("order/userConfirmCheckIn", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    orderUrge("order/orderUrge", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    acceptOrder("order/acceptOrder", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getMemberInfoByAccessToken("account/getMemberInfoByAccessToken", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getMemberInfoList("account/getMemberInfoList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    saveMemberInfo("account/saveMemberInfo", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    userConfirmCheckIn("order/userConfirmCheckIn", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    refuseOrder("order/refuseOrder", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    cancelHouse("houseAdmin/cancelHouse", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    addFeedback("feedback/addFeedbackInfo", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getMessageList("houseMessage/getMessageList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getUnReadMessageList("im/getUnReadMessageList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getOneUserMessageList("im/getOneUserMessageList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    insertMessage("im/insertMessage", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    removeMessageList("im/removeMessageList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getCurrentAppVersion("version/getCurrentAppVersion", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getBindingCardState("bankcard/getBindingCardState", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    saveBankCardInfo("bankcard/saveBankCardInfo", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getAuthInfoList("account/getAuthInfoList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getBankCardListByUid("bankcard/getBankCardListByUid", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    bindingUserId2PushService("houseMessage/saveUserRelation", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    setPushServiceOnOrOff("houseMessage/setUserRelationIsOff", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getMessageListByType("houseMessage/getMessageListByType", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    verifyBankCard("bankcard/VerifyBankCard", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    setMainBankCard("bankcard/setMainBankCard", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getMainBankCardInfoByUid("bankcard/getMainBankCardInfoByUid", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getBalanceSum("settlement/getBalanceSum", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getBalanceRecord("settlement/getBalanceRecord", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    accountToBankCard("settlement/accountToBankCard", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    logout("account/signOut", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    deleteOrder("order/orderDelete", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_POST_URL),
    getKey("help/getKey", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET),
    getLandlordHousesList("house/getLandlordHouseList", AppConstants.SERVER_URL_HOUSE, ReqType.JAVA_GET);

    private String name;
    private String url;
    private ReqType type;
    private int queueLev;

    private ApartmentAPI(String name, String url, ReqType type) {
        this(name, url, type, BaseRequestOption.QUEUE_LEVEL_FORGROUND);
    }

    private ApartmentAPI(String name, String url, ReqType type, int queueLev) {
        this.name = name;
        this.url = url;
        this.type = type;
        this.queueLev = queueLev;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return IConfig.MAPI_ROOT_URL + url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public ReqType getType() {
        return type;
    }

    public void setType(ReqType type) {
        this.type = type;
    }


    public void setQueueLev(int queueLev) {
        this.queueLev = queueLev;
    }

    /**
     * 接口定义函数名写错了，应该是getQueueLev
     */
    @Override
    public int getQueneLev() {
        return queueLev;
    }

    @Override
    public String toString() {
        return name + " " + url + " " + type + " queneLev:" + getQueneLev();
    }
}